<template>
  <div>
    <el-container>
      <el-aside width="200px" >
        <el-menu background-color="#545c64" text-color="#ffffff"
               active-text-color="#ffd04b">
          <img src="https://java103-shijz.oss-cn-chengdu.aliyuncs.com/logo.png" class="image">
          <el-submenu index="1">
            <template slot="title"><i class="el-icon-setting"></i><span>系统管理</span></template>
            <el-menu-item index="1-1" @click="$router.push('/main')">商品类别管理</el-menu-item>
            <el-menu-item index="1-2" @click="$router.push('/main/unit')">计量单位管理</el-menu-item>
            <el-menu-item index="1-3" @click="$router.push('/main/region')">区域管理</el-menu-item>
            <el-menu-item index="1-4" @click="$router.push('/main/product')">商品资料管理</el-menu-item>
            <el-menu-item index="1-5" @click="$router.push('/main/supplier')">供应商资料管理</el-menu-item>
            <el-menu-item index="1-6" @click="$router.push('/main/customer')">客户资料管理</el-menu-item>
            <el-menu-item index="1-7" @click="$router.push('/main/warehouse')">仓库管理</el-menu-item>
            <el-menu-item index="1-8" @click="$router.push('/main/department')">部门管理</el-menu-item>
            <el-menu-item index="1-9" @click="$router.push('/main/employee')">员工管理</el-menu-item>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title"><i class="el-icon-setting"></i><span>仓储管理</span></template>
            <el-menu-item index="2-1" @click="$router.push('/main/material')">原材料入库管理</el-menu-item>
            <el-menu-item index="2-2" @click="$router.push('/main/matReq')">原材料领料管理</el-menu-item>
            <el-menu-item index="2-3" @click="$router.push('/main/completeWare')">成品入库管理</el-menu-item>
            <el-menu-item index="2-4" @click="$router.push('/main/secondWarehouse')">次品入库管理</el-menu-item>
            <el-menu-item index="2-5" @click="$router.push('/main/completeProductsend')">成品发货管理</el-menu-item>
            <el-menu-item index="2-6" @click="$router.push('/main/secondProductsend')">次品处理管理</el-menu-item>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title"><i class="el-icon-setting"></i><span>订单管理</span></template>
            <el-menu-item index="3-1" @click="$router.push('/main/orderManage')">客户订单</el-menu-item>
            <el-menu-item index="3-2" @click="$router.push('/main/addOrder')">添加订单</el-menu-item>
            <el-menu-item index="3-3" @click="$router.push('/main/orderSummary')">订单汇总</el-menu-item>
            <el-menu-item index="3-4" @click="$router.push('/main/orderCheck')">审批订单</el-menu-item>
            <el-menu-item index="3-5" @click="$router.push('/main/purchasePlan')">采购计划</el-menu-item>
          </el-submenu>
          <el-submenu index="4">
            <template slot="title"><i class="el-icon-setting"></i><span>财务管理</span></template>
            <el-menu-item index="4-1" @click="$router.push('/main/receive')" >应收款管理</el-menu-item>
            <el-menu-item index="4-2" @click="$router.push('/main/pay')" >应付款管理</el-menu-item>
          </el-submenu>
          <el-submenu index="5">
            <template slot="title"><i class="el-icon-setting"></i><span>数据统计</span></template>
            <el-menu-item index="5-1" @click="$router.push('/main/Tmaterial')">原材料库存报表</el-menu-item>
            <el-menu-item index="5-2" @click="$router.push('/main/TFproduct')">成品库存报表</el-menu-item>
            <el-menu-item index="5-3" @click="$router.push('/main/TUFproduvt')">次品库存报表</el-menu-item>
            <el-menu-item index="5-4" @click="$router.push('/main/Tcustomer')">客户销售报表</el-menu-item>
            <el-menu-item index="5-5" @click="$router.push('/main/Treceive')">应收账款报表</el-menu-item>
            <el-menu-item index="5-6" @click="$router.push('/main/Tpay')">应付账款报表</el-menu-item>
          </el-submenu>
          <el-submenu index="6">
            <template slot="title" ><i class="el-icon-setting"></i><span >权限管理</span></template>
            <el-menu-item index="6-1" @click="$router.push('/main/authority')">权限分配</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-container>
        <el-header><Header></Header></el-header>
        <el-main>
          <el-main class="main" >
          <!-- 切换二级路由页面 -->
          <router-view />
        </el-main>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import Header from './main/Header';
export default {
  name: 'Index',
  components:{Header},
  props: {
    msg: String
  }
}
</script>
<style scoped>
.el-header, .el-footer {
  background-color: #B3C0D1;
  color: #333;
  text-align: center;
  line-height: 9vh;
}

.el-aside {
  background-color: #545c64;
  color: #333;
  text-align: center;
  height: 100vh;
}

.el-main {
  background-color: #E9EEF3;
  color: #333;
  text-align: center;
  height: 85vh
}
.image {
  width: 70%;
  height: auto;
  margin-left: 2rem;
  margin-top: 1rem;
  display: block;
}
</style>